namespace ImapX
{
    using System;
    using System.Collections.Generic;
    using System.Reflection;

    public class FolderCollection : List<Folder>
    {
        public Folder this[string name]
        {
            get
            {
                foreach (Folder folder in this)
                {
                    if (folder.Name.Equals(name))
                    {
                        if (folder.IsSelectable)
                        {
                            folder.Examine();
                        }
                        return folder;
                    }
                }
                return null;
            }
        }
    }
}

